/****************************************************************************\
 *
 *
 *			DEBUGGING or PRINTING ZONE
 *
 *
 ****************************************************************************/


#if !defined(H_DEBUG)
#define H_DEBUG
namespace Tablebases
{

	#if 0
	#define FOLLOW_EGTB
	#ifndef DEBUG
	#define DEBUG
	#endif
	#endif

	#define validsq(x) ((x) >= A1 && (x) <= H8)

	#if defined(DEBUG)
	static void 	print_pos (const sq_t *ws, const sq_t *bs, const pc_t *wp, const pc_t *bp);
	#endif

	#if defined(DEBUG) || defined(FOLLOW_EGTB)
	static void 	output_state (unsigned stm, const SQUARE *wSQ, const SQUARE *bSQ, 
									const SQ_CONTENT *wPC, const SQ_CONTENT *bPC);

	extern static const char *Square_str[64];
	extern static const char *P_str;

	#endif

	#ifdef FOLLOW_EGTB
		#define STAB
		#define STABCONDITION 1 /*(stm == BL && whiteSQ[0]==H1 && whiteSQ[1]==D1 && whiteSQ[2]==D3 && blackSQ[0]==C2 )*/
		static bool_t GLOB_REPORT = TRUE;
	#endif

	#if defined(FOLLOW_EGTB)
		extern static const char *Info_str[8];
	#endif

	static void		list_index (void);
	static void 	fatal_error(void);

	#ifdef STAB
		#define FOLLOW_LU(x,y)  {if (GLOB_REPORT) printf ("************** %s: %lu\n", (x), (long unsigned)(y));}
	#else
		#define FOLLOW_LU(x,y)
	#endif

	#ifdef STAB
		#define FOLLOW_LULU(x,y,z)  {if (GLOB_REPORT) printf ("************** %s: %lu, %lu\n", (x), (long unsigned)(y), (long unsigned)(z));}
	#else
		#define FOLLOW_LULU(x,y,z)
	#endif

	#ifdef STAB
		#define FOLLOW_label(x) {if (GLOB_REPORT) printf ("************** %s\n", (x));}
	#else
		#define FOLLOW_label(x)
	#endif

	#ifdef STAB
		#define FOLLOW_DTM(msg,dtm)  {if (GLOB_REPORT) printf ("************** %s: %lu, info:%s, plies:%lu \n"\
		, (msg), (long unsigned)(dtm), (Info_str[(dtm)&INFOMASK]), (long unsigned)((dtm)>>PLYSHIFT)\
		);}
	#else
		#define FOLLOW_DTM(msg,dtm)
	#endif


}
#endif
